package benchmarks.benchmarktests;

import problems.cigarettesmokers.AbstractCigaretteSmokerSolution;

public class CigaretteSmokersTest extends BenchmarkTest<AbstractCigaretteSmokerSolution> {

	public CigaretteSmokersTest(AbstractCigaretteSmokerSolution solution) {
		super(solution);
	}

	@Override
	public Thread[] InitializeThreads() {
    	Thread[] initializedThreads = new Thread[6];
    	
    	
    	//Agent
    	initializedThreads[0] = new Thread() {
        	public void run() {
        		solution.createPaperAndMatch();
        		solution.createTobaccoAndPaper();
        	}
        };

        //Pushers
        initializedThreads[1] = new Thread() {
        	public void run() {
        		solution.pushMatch();
        	}
        };
        initializedThreads[2] = new Thread() {
        	public void run() {
        		solution.pushPaper();
        		solution.pushPaper();
        	}
        };
        initializedThreads[3] = new Thread() {
        	public void run() {
        		solution.pushTobacco();
        	}
        };
        
        //Smokers
        initializedThreads[4] = new Thread() {
        	public void run() {
        		solution.consumeResourcesAsSmokerWithTobacco();
        	}
        };
        initializedThreads[5] = new Thread() {
        	public void run() {
        		solution.consumeResourcesAsSmokerWithMatch();
        	}
        };
        
        return initializedThreads;
	}

	@Override
	public void runAdditionalTests() {}
}
